Copyright: ® 1995 InterSoft International, Inc.


Help Contents
Contents

Introduction

Setup

Fonts

Colors

Desktop

ToolBar

StatusBar

SmartButtons

Host Printing

Host Editing

Command Line

Printer Logging

Session Logging

BBS Internet Doors

Firewall Support

WWW Browser Support

132 Column Support

Phone Directory

Keyboard Definition

International Video/Keyboard Mapping

FTP Server Considerations

File Transfer Considerations

Security Support

General

S/Key

Deslogin

Using Scripts

Overview

Script Syntax

Example Dialup Script

Example Ethernet Script

Example Firewall Script

Enhanced Firewall Script

Enhanced Firewall Script for Wingate


Setup

NetTerm is a general purpose communications program designed to work with bulletin boards, local area networks, and the Internet network.  Terminal emulation includes VT-100, VT-220, Nixdolf BA-80, FTTERM and the ANSI graphics standard.  NetTerm has special logic to allow for automatic processing of all escape sequences defined by the VT-100, VT-220, FTTERM and ANSI standards.  The screen foreground and background colors can be defined for each host defined within the phone book.  The font attributes bold, blinking, underscore and reverse video are implemented as user defined foreground colors.  The underscore attribute is fully supported (both with the underscore and with the color option).  The default screen foreground and background colors can be specified for each host within the phone book.

Internet access is provided for locally attached Ethernet hosts, SLIP/PPP dial up hosts and dial up 'shell' accounts.  For locally attached Ethernet and dial up 'shell' accounts, the terminal type is set to VT-100 upon log in if the ANSI option is selected.  Both VT-100 and ANSI escape sequences are provided, with automatic switching between the two.  Access to Internet hosts is provided by the standard Windows WinSock, combined with the TELNET protocol.

In addition to providing normal communications support, NetTerm can be your prime SLIP/PPP dialer program.  A built in scripting language allows for automatic dialing, log in and startup of your TCP/IP protocol program, such as Trumpet.  NetTerm provides a fast disconnect from the phone connection, something that Trumpet has problems with in most cases.  Scripts designed for Trumpet can be easily converted into the NetTerm syntax, since most commands are exactly the same.

File transfer support includes ASCII, ZMODEM and KERMIT and FTP.  The zmodem file transfer protocol offers extremely fast file transfers with all hosts which support this protocol.  In many cases, the zmodem file transfer will out perform the FTP protocol.  Requests for ZMODEM upload/download transfers are automatically detected by NetTerm.  All uploaded and downloaded files are retrieved/placed in the directory specified by the 'DownLoad' keyword within the NETTERM.INI file, the default location is the \temp directory.  The normal zmodem file management options are also included, along with support for file transfer crash recovery.

A FTP icon is located on the toolbar for access to a FTP server program.  This allows quick starting of the FTP server program by an single clink on the icon.  Once the FTP server program has been started, the functionality of this icon will change, depending upon the server type.  Refer to the "FTP Server" section for additional details.

Access to dial up hosts is provided by the standard Windows communications driver.  For high speed modem transfers (baud rates above 9600 BPS) we recommend that one of the public domain or commercial serial communications device drivers be used.

  Phone book icon

In order to communicate with a host computer, you first must setup a phone book entry for that computer.  Access to the host can occur in one of four different ways.  They are:

1.  Access via a modem to a standard RS-232 host such as a bulletin board system.

2.  Access via a modem to a Ethernet based host using Telnet and terminal emulation.

3.  Access via an established SLIP/PPP link to an Ethernet based host.

4.  Access via a locally attached Ethernet host.

The first two methods require a phone book entry of type 'modem', while methods three and four require a phone book entry type of 'TCPIP'.  Refer to the section 'Phone Directory' for detailed instructions on setting up a phone book entry.  NetTerm is distributed with several example entries already defined within the phone book.  If possible, it is recommended that methods  three and four be used to get a feel of NetTerm.

Method two is normally used to dial up an Internet Provider and access a shell account.  This method can also use the more advanced features of NetTerm to dial and establish communications with a SLIP/PPP Ethernet host.  This method requires the use of a WinSock/TCPIP protocol stack such as Trumpet.  An example, along with the required script, is provided.

If NetTerm is used only for locally attached Ethernet connections, and will not utilize a modem, then the following modem setup can be ignored.

In order to communicate with your modem, NetTerm must know the proper 'setup' values that your modem requires.  On systems where TAPI is available, this is quite easy.  Simply select the modem icon, then select the 'Use TAPI' option.  On Windows 3.x based systems, TAPI is not currently supported, so the setup values must be determined without system assistance.  The most important, and hardest value to determine is the modem initialization string.  To assist in the determination of this value, NetTerm maintains a table, modems.ini, that contains the setup values for the most common modems available.  A special test is also available which allows NetTerm to try various parameters with the modem to create a setup string.  The modem test is only to be used as a last resort, it will change any initialization string you have entered based upon replies received from the modem.

To setup the modem, select the Options-Setup-Modem menu item.  Now select the communications port to which your modem is attached and select the highest baud rate your system will handle.  Next press the 'Modems' push button and select the entry which best describes your modem, then press the 'OK' push button.  A modem setup string will now appear in the Modem Initialize Command area.  If your modem is not listed, continue with the default string.

   Connect Icon

Now connect to the modem by pressing the 'Connect' push button.  At this point you are connected to the modem.  Then enter the string 'ati4' followed by a carriage return.  If all goes well, the modem will display it's setup values on the screen.  If this does not work, try the special modem test by selecting the modem dialog again.  Now this time press the 'Test' push-button.  A series of tests will be conducted with the results displayed on the screen.  A successful test will be indicated if all goes well.  In case both tests fail, consult your modem manual for the correct setup string and enter the value into the 'modem' dialog panel.

Normally, NetTerm will hang up the phone by dropping data terminal ready (DTR) to the modem.  In most cases, this will inform the modem to hang up the phone.  Some modems may also require a specific command to complete the hang up process (such as the command 'ATH0').  These special commands can be entered in the Modem dialog panel, and will be saved in the netterm.ini file.

The global dial prefix is provided for those users which must use NetTerm for both home and work.  Most office switchboards require a prefix of '9' to access an outside phone line.  Normal Hayes modem support is provided, allowing special dial codes of 'W' (Wait for Dial Tone) and the comma (delay one second).


Fonts

The control file, NETTERM.INI, contains a user defined section which allows for the definition of special font files for the main window.  The [UserFonts] section contains three entries (FON1, FON2 and FON3) which allows for the definition of custom user font support.  To include your favorite .fon file, simply add the full path of the font after the keyword.  For example, to define a user font named myfont.fon located on the d: disk under the directory /fonts, add the following to the NETTERM.INI file:

FON1=d:\fonts\myfont.fon

When NETTERM is started, it checks for valid entries for all three custom font entries.  If present, each defined font will be loaded and available within the font dialog panel.  Upon program termination, each font will be removed from memory and will not be available to Windows.  Once a custom font is selected, NETTERM will continue to use that font until another selection is made.

Internally, NetTerm supports the special line drawing fonts required by many database display programs.  Since this mode requires two special fonts (normal text and line draw fonts), the font selection is limited to the fonts referred to as isi_oem and isi_ansi in the font selection dialog box.  If your host and application requires the line draw mode, be sure to select isi_oem  or isi_ansi as the display font.


Colors

Color within the NetTerm environment is divided into two main areas, text and graphic attributes.  Text attributes are composed of normal, underscore, blinking and reverse video.  Graphic attributes are the set of colors which can be specified by the ANSI graphics attribute for background/foreground colors.  This set contains sixteen colors, composed of the  basic eight colors; black, blue, green, cyan, red, magenta, brown and white.  Each base color is associated with the ANSI graphics color attribute zero through seven.  Each of the base colors also has a corresponding high intensity value that is used when the bold attribute is active.

Each base color and its corresponding high intensity value are placed within the main section of the windows control file 'netterm.ini', located within the Windows directory.  Each color can be identified with the keyword AnsiColorx= where x is the color index ranging from zero to seven for the base colors and eight to fifteen for their high intensity counterparts.  Although these values are normally not changed, the basic graphic attributes colors can be refined by changing the values of these entries.

The text attribute colors can be changed by using the color dialog panel.  To change an attribute, select the radio button corresponding to the text color you desire to change, then press the 'Change Color' push button.  When the windows color dialog panel appears, simply left mouse click on the desired new color then press the 'OK' push button.  The sample screen at the bottom of the color dialog panel will provide a preview of what the new color will look like.


Desktop

The desktop or window to the host system can be controlled through the desktop icon.  This activates a dialog panel which allows you to control host dependent display information such as the number of rows displayed and the number of columns.  Most systems which support the VT-100 terminal have been setup to display a maximum of twenty four lines on the video display.  However, some special applications have a need for more, so you are given a choice.  All this really controls is the screen model for those applications which create menus and expect to have a defined number of lines.  Most applications simply write lines, thus the screen will scroll whenever the maximum number of lines have been displayed.  The same is true for the maximum number of columns which can be displayed.

NetTerm supports the Telnet option NAWS which will allow it to convey window size to the Telnet server.  This option is defined within RFC-1073 and is supported by the newer Telnet servers.  When used in conjunction with the desktop number of rows/columns option, larger screen sizes can be obtained.   Refer to the 'resize' command on your UNIX host for additional information on  the use of larger screen sizes.

The return sends, line control and scroll back options further allow you to enhance the display.  The 'return sends' option determines the type of end of line sequence to send to the host.  Local echo determines how characters typed locally are treated.  If characters typed on the local keyboard do not appear on the screen, it probably means that you need to select this option.  The auto wrap options controls what happens whenever a line sent from the host exceeds the number of columns you have selected.  If auto wrap is on, any characters received after the maximum have been exceeded will be displayed on the next line.  If it is off, each character received after the maximum has been reached will be displayed in the last column.  The scroll back option determines how many received lines are saved in a memory buffer.  The contents of the scroll back buffer can be viewed by the normal windows scroll bar action and can also be saved to disk for later editing.

The scroll back option allows you to define the number of lines that are kept in the scroll back buffer.  As lines get scrolled off the screen, they are transferred to this buffer, up to a maximum of 32,767 lines.  The vertical scroll bar will use the number of lines contained within the scroll back buffer to control the relative position of the scroll button.

The 'Answer Back:' options provides a method to identify your terminal to the host system.  The contents of this text field will be sent to the host when it is requested.

The 'Terminal Type' field allows you to override the terminal identification string sent to the host when requested.  If this field is defined, it will override the default terminal type information associated with the emulation selected.  For example, if VT220 emulation is selected in the phone book for a host NetTerm will send the string "vt220" as the terminal type.  If you set the 'Terminal Type' field to "vt200", that value will be sent instead of "vt220".

The 'FTP Command' push button allows you to provide a startup information to the user defined FTP program.  This can be used with many FTP programs to provide default connection information such as user id, password, and initial startup directories.  NetTerm will pass the information specified as a part of the command line used to start the FTP program.  Refer to your FTP program documentation for valid command line options.

The following extended options further define how NetTerm controls the host connection.

The 'Add LF to received CR' and ' Add CR to received LF' can be selected if the host does not provide the normal CRLF sequence that NetTerm expects at the end of each line.

The 'Disable Application Mode' controls how the numeric keypad is handled.  In general, the keypad can be placed in one of two modes by the host, numeric and application.  Note that under both of these modes, the cursor keys, Home, PgUp, PgDn, End, Ins and Del keys do not send the same values as there 'gray' key equivalents.  Although this follows normal VTXXX protocol, some application programs expect the keypad keys to send the same values as the 'gray' keys.  The 'Disable Application Mode' will override the host requested application mode, and will treat the keypad keys the same as the 'gray' keys.  Note that this is the default option whenever ANSI is selected as the emulation.

The 'Exit NetTerm on disconnect' option provides a quick method of quitting NetTerm any time the line connection has been closed.  When this option is selected (checked), NetTerm will exit whenever the 'disconnect icon' is pressed or when the host has closed the current connection as a result of the log off command 'exit'.

The 'Do not disconnect if session active' options prevents closing the Telnet connection as long as you are logged into the host.  The option is helpful for those sites that require an orderly shutdown of applications such as databases.

The 'Add CR to received LF' and 'Select linemode for local input' is required for some 'Talker' applications.  If you Telnet to a site and the lines appear not to be followed by a carriage return, try the first option.  If the host complains that the input is incorrect when you type just one character, the second option is required.

The 'Exclude this host from firewall setting' option will bypass all firewall support for this host.

The 'Do not translate defined key assignments' instructs NetTerm to send user defined key definitions regardless of instructions received from the host to do otherwise.

The left mouse click options specify the action to take when NetTerm detects a left mouse click within it's window.


ToolBar

The toolbar, located at the top of the main window, provides one click access to commonly used functions. The toolbar contains thirteen icons, divided into three major groups.

The first four icons provide basic screen, clipboard and printer management for NetTerm.  The first two icons, Copy and Paste provides standard Windows clipboard support.  Text within the text window is selected using normal Windows text selection.  When pasting into NetTerm, position the cursor where the text should start, then depress the Paste icon.  The third icon, Picture, will capture the current screen to a user specified file.  The fourth icon, Printer, will start a user definable printer program to print text files.

The second group of icons provides network and file transfer control.  The first icon, Connect, will connect to the selected network.  If the 'Modem' network connection has been specified, the phone number will be dialed to establish the connection.  The next icon, Disconnect, will disconnect the network connection, including hanging up the phone and disconnecting the modem.  The third icon, File Transfer, will start either a user defined FTP server for network file transfers or will activate it's own FTP server.  Refer to the section "FTP Server" for setup and detailed usage information.  The fourth icon, FTP, will start a user defined FTP program.  An optional startup command can be passed to the FTP program.  The optional startup command is host specific and is specified in the desktop dialog panel.

The third group of icons provide for custom configuration of NetTerm.  They have the following functions:

Directory	Select the phone directory dialog

Font	Font dialog panel

Color	Set the screen colors

Keyboard	Select the keyboard configuration dialog panel

Desktop 	Select the desktop configuration panel

The Menu contains six primary selections; File, Edit, Options, Send, Receive and Help.  The File menu contains an alternative method for network connection and disconnect.  In addition, the Exit option will terminate the program.  The Edit menu contains normal clipboard copy and paste selections as well as an item to allow for screen capture.

The Options menu contains the user setup and configuration items for defining the modem setup, the FTP server, general Setup, Colors, Network type, Keyboard selection and Emulation type.

Menu items Send and Receive allow selection of commonly used file transfer protocols

The Help menu item provides an extensive on-line help as well as ordering and registration support.


StatusBar

The status bar is composed of nine informational areas composed of:

1.  Connection status

2.  FTP Server status

3.  Printer status

4.  Security indicator

5.  Emulation type

6.  Host type

7.  Current or elapsed time

 	8.  LED display

9.  Message area

The connection status area provides a visual indication of the current connection status to the host.  A red ball indicates that the connection is closed.  A green ball means the connection is open or active.  The FTP server status area will contain a blue ball if the server is active.  If the printer is active, a small printer icon will be displayed in the Printer status area.  The security area will contain a key if NetTerm is in secure mode.  The LED display contains four LED lights that can be turned on by the VT100 escape command ESC[xq where x is the LED number to turn on.

The message area can be cleared at any time, simply by placing the mouse cursor over the text and clicking the left mouse button once.


SmartButtons

SmartButtons provide a quick and easy way to send keystrokes to the host using the mouse.  The buttons are located directly below the toolbar and can contain up to eight buttons; each one can be defined with a button label and up to 255 characters that will be sent to the host system when pressed.  Control characters such as carriage return can be a part of the string and follow the same conventions as defining keys within the keyboard dialog box.  An example of the use of SmartButtons to perform several commands is:

cd statbot^Mrm *.db^Mstatbot^Mcd ..^M

SmartButtons also allow NetTerm menu items and user written scripts to be selected, providing a quick and easy way to access commonly used menu items and control a complex program startup on the host.  This menu feature is enabled by placing the internal menu identifier in the dialog box instead of the host command.  The menu identifier must be prefixed with the '~' character.  For example, the internal identifier for the print screen menu item is 10005 so the entry would be:

~10005

The script feature is enabled by prefixing the full path of the script with the '@' character.  For example, to start a script named runtime.txt located on the 'd' drive under the directory \scripts, the entry would be:

@d:\scripts\runtime.txt

Since the internal menu identifiers can change, and new ones added, the most current values will be listed in the FAQ file for reference.

SmartButtons are defined within the Option-Setup menu item.  Labels can contain up to thirteen characters, but keep in mind that the size of the buttons will vary with the screen width.  Once any button is defined, the bar will be displayed each time the host is selected.  To remove the SmartButton bar, simply remove the definitions from the SmartButton dialog box.  SmartButtons can also be enabled/disabled on a global basis by the Options-Setup item 'Allow Smart Button Bar'.  A unique SmartButton bar can be defined for each host.


Host Printing

NetTerm has the ability to recognize the standard UNIX escape sequences for printing.  Whenever the escape sequence ESC[5i is received, a temporary file will be created and opened.  Any data received after this point will be written to the file.  When the escape sequence ESC[4i is received, the file will be closed.  The characters 'ESC' represents the ascii escape character which has a value of 27.   The following is an example of a UNIX script which will send the contents of a UNIX file to a local file for printing:

#!/bin/sh

echo 'ESC[5i'

cat $1

echo 'ESC[4i'

There may be times when it would be useful to toggle transparent printing directly from the workstation.  NetTerm provides this support with the options 'Transparent Printing On' and 'Transparent Printing Off' located within the file menu.

Data received after the transparent print option has been turned on will be captured in a temporary disk file.  Once the printer data has been received and transparent printing is turned off, the file will be printed on your default windows printer or processed according to the print option selected.  The default font and font size for the printed file can be selected with the menu option 'Options-Setup-Transparent Printer Setup'.  The temporary file which was created will be deleted by NetTerm, if the 'delete file option is selected'.  The following options control the handling of the printer data:

1.  Receive File only - Place the print data into a file.

2.  Send to windows printer - Send to the default windows printer driver for processing.

3.  Write directly to the printer - Bypass the windows printer driver and write directly to locally attach printer.

4.  Start user defined print program - Start the user defined print program, passing the file name.

5.  Start user editor program and edit the file - Start the user defined edit program, passing the file name.

6.  Add the print file directly to the Windows spooler queue - Add file directly to spooler queue.

7.  SmartPrint (Queue all printout - Print on user demand)

Options three and six are designed to handle print files which contain special printer control characters.  These two options should be used when printer formatting is done on the host.  An example of this is a host based application that creates a form which includes laser jet print commands to set the font size, orientation, etc.  Option three should be used if the printer is directly attached to your computer.  Option six should be used if the printer is network attached.  Note that the File option 'Print Screen'  is also controlled by the six print options, although option two is normally used.

The SmartPrint option allows for the receipt of multiple print documents through out the session to be placed within a common print file.  The file can be printed, saved to another file, edited or deleted at any time.  If the file has not been processed at the session logoff, NetTerm will request for a final disposition of the file.

The file 'netprint', located within the NetTerm directory, should be uploaded to your host using the rz command.  Then issue the command chmod +x netprint.  To print a file, simply enter netprint xxxxxx on the host, where xxxxxx is the file name to be printed.  In essence, the netprint script can download any ASCII file to your machine.  It passes all data received from the UNIX host to the local file, except for the binary zero character.


Host Editing

The host editing feature allows text based files to be downloaded from the host, and passed to a user defined editor for modification or viewing.  This feature requires a special program (named netedit.c) to be uploaded to your host and then compiled and linked .  Simply transfer the file netedit.c (located in the netterm directory) to your host then issue the following commands:

cc netedit.c -o netedit

chmod +x netedit

On some systems, you can also replace the first line with make netedit, then do the chmod +x netedit command.

To edit a host file, simply enter 'netedit xxxxxx' where xxxxxx is the filename to be edited.  The file will then be transferred to your system, and the user defined editor will be started with the filename received as a command line input.  The Windows program 'notepad' is sufficient for most cases.  If you make any changes to the file, be sure to save it.  NetTerm can then detect that changes were made, and will then upload the file back to the host system.  If no changes are made, NetTerm will inform the host base netedit program of that fact.  If changes are made, the host based netedit program will create a new file, and if successful, it will replace the current file with the new file.

The host editing feature described above uses the same logic as transparent printing to transfer files to the local machine and uses the same basic logic as ASCII file transfers to return the file back to the host.  Although effective on most UNIX machines, some text files contain data that will prevent successful uploads back to the host.  This is caused by text files containing 'long lines' such as those produced by word processors or some HTML editors.

A second, more powerful way for editing host files is with the SmartEdit feature.  This method uses the standard zmodem file transfer to move files between the host and NetTerm for editing, thus allowing binary files such as bitmaps and other graphic files to be edited with a graphical editor.  Since the standard zmodem file transfer routines are used, all the normal file transfer options apply.  This allows a file to be transferred, retaining its file name on the local machine.  For the 32 bit version of NetTerm, long filenames are supported.  The SmartEdit feature requires that the file 'se' be transferred to the host.  Once it is on the host just enter chmod +x se to enable it for operation.

SmartEdit uses the normal Windows extension support to determine which program to use to edit the file.  If a file association is not found, the default user defined editor will be used.  If a default editor has not been defined, Notepad will be used.  As with the first editing method, NetTerm will examine the file length, date and time to determine if the file was changed when the editing program exits.


Command Line

When started, NetTerm will check for command line arguments.  The first argument must be a host name, followed by an optional Telnet port for tcpip hosts.  If a host name is given, NetTerm will attempt to locate that name in the phone book.  If found, a connection will be attempted using the phone book settings.  If the host name is not located within the phone book, then NetTerm will assume that the host name is an Internet host  consisting of either an IP address or a network host name.  If a network host name is given, a DNS lookup will be issued to determine the IP address.

If  a phone book host name contains spaces, and a Telnet port is required as a part of the command line, then the host name must be enclosed in quotes.  The following are examples of valid command line arguments:

myhost.com

myhost.com 23

"my phone book name"

"my phone book name" 23

The command line can also contain an optional script name to control the connection to the host.  If supplied, the script will override any script attached to a host's phone book entry.  The script must be the last command line argument and be preceded by the keyword "-s".  For example, to connect to myhost.com on port 9000 using the script myscript.txt, the following would be entered on the command line:

myhost.com 9000 -s myscript.txt

The optional command line argument -t can be used to pass a host name into a script.  This is primarly used by sites that are behind a firewall.  For example, the command line argument could contain:

netterm firewall -s proxy.txt -t target.host

The script 'proxy.txt' would contain a line such as:

output "c ^t"

and NetTerm's script processor would place target.host in place of the ^t.

The optional command line argument -i can be used to pass an optional netterm.ini file to NetTerm.  If present, NetTerm will use the new .ini file instead of the normal .ini file.  This command confirms to the Netscape standard for passing an optional .ini file into a program.

NetTerm can also be called from a browser such as the Netscape Navigator and the Microsoft Internet Explorer.  If you use Navigator, select the Navigator Options-General Preferences-Apps tab and use the Browse button to select NetTerm as your Telnet application.  If you use the Windows 95/NT Internet Explorer, select the NetTerm Options-Setup-Set Registry Telnet Handler menu item.  Refer to your browser  instructions on defining a Telnet application helper for all others.


Printer Logging

Printer logging allows everything that is displayed on the screen to be sent directly to the printer at the same time.  It is turned on from the File menu by selecting the 'Printer Logging' option.  To use this option, your printer must be directly attached to your computer and available for printing.  Logging can be toggled on/off during the session simply by selecting the option.  When the option is checked, logging is on.  Note that information received from the host in full screen mode may not be printed correctly.


Session Logging

Session logging provides a audit trail of data received from the host.  It is turned on from the File menu by selecting the 'Session Logging' option.  The first time logging is requested, you will be asked to provide the disk file name for saving the session information.  If the file does not exist, it will be created.  If it does exist, data will be appended to the file.  Logging can be toggled on/off during the session simply by selecting the option.  When the option is checked, logging is on.  Note that information received from the host in full screen mode may not be fully captured.

Under most conditions, a unique log file name should be selected for each session.  NetTerm will however allow two or more sessions to share a common log file.


BBS Internet Doors

Many modern BBS's have the capability to allow access to the Internet, providing full SLIP/PPP support.  Since the connection to the BBS is with a normal dial up phone connection, those desiring to use this feature must also have the Trumpet winsock loaded on their system.  Since this option is BBS specific, refer to the detailed instructions provided by your BBS for instructions on how to setup and use NetTerm with their service.


Firewall Support

NetTerm can support sites that require a firewall in several different ways.  The most basic method is to create a phone book entry for the firewall computer providing a name of 'firewall', the IP address and the telnet port of the firewall.  Then use the command line argument of 'netterm firewall -s proxy.txt -t target.host' to start NetTerm.  The -s command line argument specifies the script file to use for the firewall host and the -t specifies the host to telnet to after connecting to the firewall.  Refer to Example Firewall Script for the contents of the firewall script.

The second method is to use the Options-Setup-Firewall to specify the firewall host name/IP address, telnet port and script file to use.  Then select the 'Standard Firewall' checkbox.  When a host is selected from the phone book, NetTerm will first connect to the firewall using the firewall script, then will transfer script control over to the script file specified in the host phone book entry.  Refer to the Enhanced Firewall Script for the contents of the firewall script file.

The third method is to use the SOCKS 4 protocol.  Select the Options-Setup-Firewall option to specify the firewall host name/IP address, telnet port and user name.  Then select the 'SOCKS Firewall' checkbox.

Once the firewall support has been enabled, it will apply to all hosts within the phone book.  The desktop dialog panel can be used to exclude a host from the current firewall setting.  Simply select the host in the phone book, press the 'Desktop' push button and then select the option 'Exclude this host from the firewall setting'.  The firewall support can be disabled for all hosts by selecting the option 'Disable' in the firewall dialog box.


WWW Browser Support

NetTerm is designed to be the preferred client of choice for Netscape.  Select any Telnet URL within Netscape and NetTerm will connect to that site.  In addition, if you come across any type of URL while in a Telnet session, simply right mouse click on the URL and NetTerm will use it's internal DDE client logic to tell Netscape to connect to that URL.  NetTerm will also work with most other WWW browsers, but instead of using DDE to tell the browser to process the URL, it will start the browser with the URL on the command line.

The location of your browser must be defined with the Options-Setup-Define Browser Program prior to using the URL display function.


 132 Column Support

Applications that require 132 column support normally issue a command to let NetTerm know that it should alter it's internal emulation to handle lines greater than eighty columns.  NetTerm can do this in one of two ways.  It can change the window width to process 132 columns or it can accept the data in the current window size, and allow horizontal scrolling to view data that exceeds 80 columns.  On screens that support the VGA enhanced mode, the larger width screen makes for easy viewing of report type data.  However on those systems that only have VGA mode, the horizontal scrolling logic allows the report to be viewed.

The choice between a larger screen size or horizontal scrolling is provided within the Options-Setup menu.  If the option 'Allow 132 Column Scrolling' is checked, then horizontal scrolling will be enabled, otherwise the screen size will be adjusted.

At times it may be useful to enter into 132 column support manually.  For example, you may have a copy of a report on your Internet host that contains lines in excess of eighty characters.  To view the file, you could press a SmartButton to enter 132 column mode and view the file.  When you are done, press a SmartButton that will go back to 80 column mode.  Of course, you could always write a UNIX script that would place NetTerm into 80/132 column mode.  Then you could cat the file.  After the report has been viewed, you would run the script again to return to 80 column mode.  The following commands can be placed within SmartButtons to enable/disable 132 column support:

Enable 132 column support 	echo "\033[?3h"^M

Disable 132 column support	echo "\033[?3l"^M


Phone Directory

Get quick access to the phone book with this icon.

A phone book is maintained for commonly accessed ethernet and dial up hosts.  It consists of a list box which contains the names of the hosts and a section where detailed information regarding the host can be entered.  The detail section is divided into the following major areas:

Host Name

Host Number

Modem Control Information

The host name can take one of two forms, depending upon it's type.  If the host is a dial up service, the name can be any descriptive name.  If the host is a network host, the name can be any descriptive name, or it can be the actual network name of the host.  Network names must be fully qualified.  The host name has a maximum length of 255 characters.

The host number can also take one of two forms, depending on the host type.  If the host is a dial up service, this field must contain the basic phone number of the host.  If the host is a network host, this field may be left blank, or it can contain the network IP address of the host or the fully qualified name of the host.  If the network IP address is placed in this field, it will be used by NetTerm to establish a network connection.  If a fully qualified network name is entered, NetTerm will use DNS to determine the IP address.  If this field is left blank, the host name field must contain the fully qualified network name of the host.  NetTerm will use this name to do a DNS (Domain Name Service) search to determine the network IP address.

The modem control information area only applies to dial up hosts.  This area consists of the phone number suffix, PIN, baud rate and modem settings.

The phone number suffix further defines the basic phone number field.  Under normal conditions, the basic phone number consists of the area code (optional), and the seven digit phone number.  The phone number suffix allows for the addition of special control information required by corporate and other specialized phone systems.  The phone suffix can also be coded to include a PIN (Personal Identification Number).  If a PIN has been defined, it will be inserted wherever the 'P' character appears in the suffix.  The PIN number can be defined within the Options-Setup-menu, and is encrypted when placed in the netterm.ini file.  The basic phone number can also be further defined to include a global dial prefix, located within the modem dialog panel.  The final number that NetTerm will use for dialing with consist of the prefix, phone number, suffix and the PIN number.

The modem control area contains data related to the modem.   It contains an entry for baud rate, parity, data bits, and the number of stop bits.  All modem control values are set by pressing the Modem push button which will bring up the modem dialog panel.

The control data area has three entries; keyboard type, emulation, connection type and an optional script name.  Keyboard definitions refer to both default and custom user defined definitions, covered in more detail within the Keyboard Definition area.  The emulation type can be ANSI, VT100, VT-220 or FTTERM.  Most UNIX systems support  ANSI, VT-100 and VT-220 terminal types.  The ANSI type supports full color and can be used on most dial up bulletin board systems.  The connection type can be either modem or tcpip.

All ethernet hosts are of the type "tcpip", even if they are connected over a modem using SLIP/PPP.  Ethernet hosts can have their network address specified in the phone number field.  If specified, that address will be used for the connection.  If it is not specified, normal network database lookup will be used to find the address.  The actual method(s) depends upon the network software you have installed on your system.  NetTerm also has a built in 'resolve' routine (under the Options menu-Resolve)  to lookup the IP address or host name, if either is supplied.  This option also allows the host to be 'pinged' to test the network connection.

Modem connected hosts are of the type "modem".  NetTerm supports the  modem standard for all communications with the modem.  If desired, you can enter a modem startup command within the modem dialog panel.  This command will be sent to the modem prior to sending the phone number and dial command.

Internet providers, connected via a modem, are also of the type "modem".  Once the modem connection is established to these type of hosts, control is normally passed to the SLIP/PPP ethernet control program (such as Trumpet).  NetTerm is simply acting as a dialer and manager of the modem port.  Once the ethernet control program has stopped, control is then passed back to NetTerm, to hang up the phone.  These type of entries must have a valid script (see the example neosoft1.txt) to setup and start the ethernet control program.

If a phone book entry contains a script, it will be executed upon connection to the host.  The script name must contain the full path and filename, unless the filename is prefixed with the '~' character.  If the script name is prefixed with the `~' character, it is replaced with the path of the directory from which NetTerm was started.  If NetTerm was installed in the directory c:\tcpapps, an entry of ~unix.txt would be expanded to c:\tcpapps\unix.txt.

Although scripting allows for storing and processing of passwords, it is highly recommended that passwords be left out of script files or at the very least you should encrypt script files whenever you are away from your computer, or secure your computer from unauthorized access.  The best way is to use the 'password' script keyword which will interrupt the script and ask you for your password.

If NetTerm is started with a host name on the command line, it will attempt to lookup the host name in the phone book.  If it is found, it will be used for the connection.  If the entry is not in the phone book, the entry "Telnet Default" will be used.  This allows NetTerm to be called from a WWW client program such as Netscape.

The 'LocalNet' entry has special meaning to NetTerm.  If selected, NetTerm will treat the 'Connect' request as a request to connect to local ethernet network.  This entry must have a valid script (see the example localnet.txt file) which will be used to setup Trumpet (or other local network TCP/IP software).  This option is only used on those systems which are locally attached to a ethernet network.  This option can be used to flip back and forth between a locally attached network and dialup networks using SLIP/PPP.

Before selecting baud rates above 28 kbps, your should be aware that under most conditions you will have to replace your Windows communications driver with one designed for high speed data transfers.  We have found that the cybercom.drv (cyberdrv.zip) is a good  replacement for the standard Windows driver allowing data transfers up to 115 kbps.  In addition, you must have a 16550 serial port chip and operate Windows 3.1 in enhanced mode at these transfer rates.

More:

Directory Maintenance


Directory Maintenance

The phone book is designed to provide fast access to commonly used hosts.  Hosts can be one of two types, TCPIP  or modem (refer to the "Phone Directory" for more detailed information).  Hosts are selected within the phone book by clicking once with the left mouse button on the host name within the host list box.  The selected host will then be highlighted.  Double clicking the left mouse button on a host name will close the phone directory and connect to the host.

TCPIP hosts are those that are accessed over a local ethernet connection, or through a dialed up SLIP/PPP connection.  In order to connect to this type of host, NetTerm must know either its fully qualified host name or its IP address.  If only the host name is given, NetTerm will attempt to do a DNS lookup in order to get the IP address.  If an IP address is contained within the phone book, it will be used directly (resulting in faster connects since the DNS lookup is not required).  Modem information for this type of host is not required, and will not be used if given.

Modem style hosts normally are bulletin boards, services such as CompuServe or an Internet Provider.  This style of host entry must have complete modem information and phone number.  If the host is an Internet Provider, then it also is a telnet style host.

The quickest way to add a host is to select an existing one which is like the one you would like to add.  For example, to add a new TCPIP host, select the "Telnet Default" entry, then enter the new host name and/or IP Address.  Then press the add button.  To connect to the host, simply double click on the new host entry.

To change information for a host, select the desired host and enter the new information in the data entry area directly below the host list box.  If the host is of type modem, press the Modem push button to get the modem dialog box.  Change whatever is desired and press the OK button to exit the modem dialog box.  Once all changes have been made, press the Change button.

To delete a host, select the desired host and press the Delete button.

Under most conditions, the ANSI emulation type should be selected.  This emulation contains all the normal VT-100 abilities, and includes support for background/foreground text colors.  The prime difference between VT-100 and ANSI is the way the numeric keypad is handled.  Refer to the section on Keyboard Definition for additional details.  The FTTERM mode, although supported, is for communication to IBM mainframe computers and is not normally used.

Once a host is selected, it becomes the active host.  Changes to styles such as font, font color, background color and desktop top settings are always applied to the active host.  All style changes are immediately applied to the active host and are saved in the netterm.ini file .

Connection to the active host can be done in one of four ways.  While the phone book is opened, you can double click on the host entry within the host window, or you can press on the 'Connect' button.  When the phone book is closed, you can press the 'Connect' icon or use the File-Connect from the menu.  If you are currently connected to a host, the first two methods will request a new instance of NetTerm.  The current connection will remain connected.  This process can be repeated for as many copies of NetTerm as needed.  To switch between open connections (or instances of NetTerm), use the normal 'Alt-Tab' sequence.


Keyboard Definition

Keyboard definition for problematic keys are supported through a standard dialog panel.  Selected keys, displayed within the dialog panel, can be programmed to transmit strings of your choosing.  Each key can be set up to transmit one string when pressed by itself, a second string when pressed together with the <Shift> key, a third string when a key is pressed together with the <Ctrl> key, a fourth string when the Num Lock key is on a fifth string when a key is pressed together with both <Ctrl> and <Shift> and a sixth string when a key is pressed together with the <alt> key.  The key definitions are stored concatenated together into a single string, whose total length cannot exceed 60 characters. The sub-strings are separated by the pipe character ('|', ASCII 0174).  Normal VT emulation provides for dynamic key definitions, which at times may change values which have been defined within this dialog panel.  To prevent this, select the desktop option 'Do not translate defined key assignments'.

Special sequences such as escape, carriage return and line feed are specified with the '^' symbol along with the printable 'equivalent' of the character.  For example <Ctrl-c> would be encoded as ^C.  To send the '^' symbol, you must escape it with the '\' character.  The following are some additional samples:

^[	Escape

^M	Carriage Return

^J	Line Feed

Special sequences can appear at any point within the user defined string for the specified key.  For UNIX systems, the definition must match that within the corresponding TERMCAP or TERMINFO file.  For dial up lines, the keys can be defined to send any string.  For example, you could define F1 to send the string 'ftp ftp.cica.indiana.edu^M' and F2 could be defined to send your Email address.  Custom keyboard definitions are saved in the NETTERM.INI file for later use.

The Windows Common User Access: Advanced Interface Design Guide gives special meaning to the F1 key and the ALT key sequence.  This presents programs such as NetTerm with some design problems, since it must pass keys to another host, which in turn will process the keys according to their rules.

The F1 key is defined by the CUA guide as a user help key.  NetTerm will treat F1 as a user help key if it is not connected to any host, otherwise it will be passed on the host system as any other key.  The ALT key sequence will normally be treated according to the CUA guide, that is these key codes will not be sent to the host.  There are two exceptions to this.  The first exception to this is for the twelve keys F1-F12.  If these keys are defined with the ALT key modifier, then the defined data with be sent to the host.  If the key is not defined, normal window actions will be honored.  For example, ALT-F4 is normally used to terminate a program.  If you define ALT-F4 using the keyboard dialog panel, then that definition will be sent to the host, and the normal windows action will not take place.  The second exception is for the ALT-Pause.  This key combination is used on network type connections to flush all received network data, and to send a Telnet abort request to the host.  This is useful for programs that get in a print loop or by entering a command such as 'ls -R' by accident.  When the ALT-Pause is pressed, a stop symbol will be displayed on the statusbar indicating that all network data is being flushed.  To resume normal operations, press the ALT-Pause sequence again.  The stop symbol will be removed from the statusbar and normal operations will resume.

 Keyboard Icon

To setup custom values for keys, press the keyboard icon to bring up the keyboard dialog panel.  Check to see if the keyboard definition you desire to change is loaded (lower left corner of the panel).  If it is not, press the Load push-button and select the desired definition.  To define a key, simply click the key with the mouse button and enter the new definition within the edit box at the bottom of the panel.  After you have entered the new panel, press the Change push-button to make the change.  If you want to define a shift or Ctrl key sequence, click either shift or Ctrl first, then click on the desired key.  The shift or Ctrl will stay on (as indicated by the buttons on the upper right of the panel) until you click on this again.  Once you have made all your changes, save the values by depressing the Save push-button.  If you want to give the definition a new name, do so now.  The left Ctrl, Alt, Shift and Caps Lock keys cannot be programmed.  Normally, the only keys you should program is the twelve function keys.  The most common reason to program any key is to reduce a long sequence of characters to a simple keystroke.

More:

Accelerators

Numeric Keypad


Accelerators

Since NetTerm is designed to provide keyboard input for another host, the use of accelerators have been minimized to avoid conflicts with key definitions required by the host.  The two exceptions to this is for the clipboard copy and paste functions.  The accelerators Ctrl+Ins and Shift+Ins have been chosen for these.  In addition, an option has been added to the Options-Setup menu to turn on/off the use of accelerators.  The default is off, which means the accelerators are not active.  To allow the use of accelerators,  simply select the 'Allow Edit Accelerators' option.   A check mark will indicate that the option is turned on.


Numeric Keypad

The numeric keypad presents some additional requirements upon NetTerm.  The definition of the keys depends upon the state of the Num Lock key, and the type of emulation.  The emulation type, VT-100, ANSI and FTTERM will determine what value gets sent to the host, and whether the key can be programmed.  For this discussion, emulation types ANSI and FTTERM will be treated as the same and simply referred to as ANSI.  Since the comma key is not contained on the PC numeric keypad, the key keypad plus is used as the numeric keypad comma.

If VT-100 emulation has been selected for the host, the keypad is controlled by the host computer.  Under normal conditions, the keypad is placed into 'application mode'.


International Video/Keyboard Mapping

NetTerm maintains an internal mapping table for both the video and keyboard which allows  defining what gets displayed/processed for  both.  The video table, composed of 224 entries, allows the mapping of incoming network data to match the language where the program is being run.  In general, mapping should only be used with an ANSI style font such as Courier New and isi_ansi.  The option Options-Setup-International-Video Mapping dialog panel allows each unique incoming network data character (above the decimal value of 31) to be mapped to another value.

The keyboard mapping option allows for mapping the 'normal' keys to match the language where the program is being run.  These keys are the ones that cannot be mapped in the keyboard definition dialog panel.  Mapping is done based upon the keyboard scan code.  To determine the scan code for a key, use the 'Show Scan Codes' option.


FTP Server Considerations

NetTerm provides support for both a user defined FTP server and it's own FTP server, NetFtpd.  The included server provides the most common features of a FTP server, but in some cases, a  special purpose server may be desired.  By default, NetTerm uses it's own server when the File Transfer icon is pressed.  If a special purpose server is desired, it can be specified within the Options, Setup, Define FTP Server menu or by editing the NETTERM.INI file and setting the keyword ftpserver=  to the full path of the desired program.

When the File Transfer icon is pressed, the FTP server will be started.  If the File Transfer icon is pressed again, the server will be stopped.  Once the server is started, the status bar will be updated to include a blue colored ball indicating the willingness of the server to accept external connect requests.  Once the server is stopped, the ball will be removed.  Two features are provided within NetTerm to allow easier use of the server program, while you are logged onto a UNIX host system.  Within the Options, Tools menu is an item labeled "This host".  When this option is selected, the current IP address and host name of the local system will be displayed.  This feature is primarily useful for those who have a dynamic IP address assigned by the host system.  The second feature, located within the Edit menu, will paste the command "ftp xxx.xxx.xxx.xxx' at the current cursor positon within the NetTerm window.  The xxx.xxx.xxx.xxx will be replaced by the current IP address.  This allows for fast ftp requests to your local system.

The data transfer speed of data sent from your machine to another machine is very dependent upon buffer size and the type of network you are attached to.  Within the Options-Define FTP Server access dialog panel is an item that contols the buffer size for all file sends from the local machine.  If you are directly attached to a LAN or other high speed network connection, set this value to 32000 (the maximum).  If you are attached to the modem based dial up network, set this value to 966 (the default).  This values specifies the maximum amount of data that will be sent to the winsock.dll per call.  For optimum performance with your system, you should try various values for this parameter.

Currently, NetFtpd supports user directory access, general access control and provides the ability to require and process user passwords.  The passwords are encrypted and stored within a file of your choice, but you should be aware that the encryption process is a very simple one.  If you are concerned about the privacy of these passwords, you should take additional steps to prevent this file from being accessed.

General access is controlled by the Options-Define FTP Server Access item.  When selected, a dialog panel will appear allowing you to define the current access level for all connect requests.  By default, the FTP server has unrestricted access, including the anonymous user request.  The following access rights are supported:

No Access

Accept anyone who calls

Requires a userid and password

Allow anonymous access

The 'No Access' option will prevent the starting and operation of the FTP server by anyone.  If you do not desire to accept any FTP requests to your system, then select this option.  The 'Accept anyone who calls' options allows anyone to connect to your machine with a valid userid.  The 'Requires a userid and password' option will only allow selected userid's to access your machine.  In addition, a valid password must be entered in order to gain access.  The 'Allow anonymous access' option is like the 'Accept anyone who calls' option, but the userid anonymous can be used and a email address will be accepted as the password.  This dialog panel also contains the location of the userid/password file and should be specified, if you desire to restrict access by userid and password.  The full path and filename must be provided.

When the option 'Requires a userid and password' is selected, then you must create a file which will contain a list of userid's and passwords.  This is done by using the Options-Setup FTP Server Passwords option.  The location of this file must have been defined when you select the 'Requires a userid and password' option.  The file consists of one line for each user, containing both the userid and an encrypted password.  Both the userid and password is limited to eight characters in length.

User access control allows you to define both the read and write directories that a user has access to (including the anonymous user) on your system.  The read access allows directory listings, viewing, and downloading of files contained within the read directory and all directories below the read directory.  The write access directory allows writing and deleting of files within the write directory and all directories below the write directory.  The write directory must be a directory below, or the same as, the read directory.  The default for both the read and write user directory is the NetTerm download directory.  The NetFtpd Option-Setup User Directories provides the facility to define the user read/write directories.  Note that once a user has been added with this facility, the only way to remove that user is to manually edit the netterm.ini file and delete the user from the [FTP-Users] section.

All ftp server transactions are recorded in the file 'ftpd.txt' located within the directory specified by the 'Log File' keyword within the netterm.ini file.  The default location is c:\temp.  The file will contain detailed information about each connection request such as date/time, userid, and commands processed.  Each connection request is appended to this file, so it can be maintained for future reference.


File Transfer Considerations

NetTerm currently supports the ASCII, Kermit, Zmodem file and FTP file transfer types.

The ASCII transfer is not really a file transfer protocol, it simply provides a method of transferring data with hosts that cannot support the normal file transfer protocols.  The Send ASCII option requires the host to be in a state in which it is ready to receive a continuous flow of data.  Normally this would be used within an editor or mail program at the point that data is expected to be input in a continuous flow from the keyboard.  Selecting the Send ASCII option will request a file name, open the local file and send the contents to the host.  When the entire file has been sent, it will close the local file and terminate the file transfer request.  The Receive ASCII option also requires some type of host action, such as typing the contents of a file with the UNIX cat command.  When this option is selected, it will request the name of the local file, open it and then will capture all data sent from the host.  It will continue to capture data until the option is selected again.  At that point, the local file will be closed and the file transfer will terminate.  Any time the Receive ASCII option is active, a check mark will appear to the left of the Receive ASCII menu item.  Both the Send and Receive ASCII requests will honor the CRLF file transfer option within the Options-Setup-Set File Transfer Options dialog box.

The zodem protocol is by far the fastest file transfer protocol available.  Numerous options are available (selected from the menu Options-Setup-Set File Transfer Options dialog panel.  When sending files to a remote host, NetTerm honors the following file management options:

ZMNEWL	Transfer file if destination file is absent, else overwrite if source is newer or longer.

ZMAPND	Append local file to the contents of the destination file.

ZMCLOB	Replace the destination file, even if it exists.

ZMDIFF  	Transfer file if destination file is absent, otherwise replace if different length or date.

ZMPROT	Transfer file only if it does not exist on the host.

ZMNEW	Transfer file if destination files is absent.  If present, overwrite if source is newer.

NetTerm also supports 'crash recovery' with zmodem.  This simply means that if an error occurred while transferring a file, any subsequent transfers of the same file will proceed where the error occurred.  This is extremely useful for long file transfers interrupted by loss of carrier or other errors.  The option 'Do not buffer on send' should only be checked if you are having problems sending data to a host.  NetTerm normally buffers all outgoing data to achieve maximum transfer rates.  On some hosts, buffering forces an overrun condition;  this option should be used for these type of hosts.

ASCII zmodem downloads are also supported (using the sz -a option on the host).  If NetTerm receives a download request which specifies the ZCNL option (convert received end of line to DOS end of line) all new line characters are preceded with a carriage return prior to writing to the local file.  The ZCNL option is sent by the host when you request sz with the -a option.  Please use this option with care, if the host file already contains normal DOS end of line characters, you will end up with a file that contains an extra carriage return.  Also, since the host file was expanded in size (by the addition of the carriage return for each line), crash recovery will not work properly!

If the zmodem option sz -f is used for downloads, the full path name must exist on the local machine.  For example, if the command sz -f ~/work/file.c was issued at the UNIX host, it would be expanded by the UNIX host to its full path name.  This could be something like /u/z/zkrr01/work/file.c on the UNIX system.  On the local machine, the path /u/z/zkrr01/work must already exist or the transfer request will fail.  Use this option with extreme care.

The 'block before write' option can be selected if overruns occur on file download.  For SLIP/PPP and local ethernet connections, this options has no meaning, since flow control is under the control of the TCP/IP protocol.  For other types of modem transfers, it will correct most overflow conditions.

Under most conditions, the zmodem options should be no window, overwrite existing file always (zmclob).


General

InterSoft International, Inc. supports, or will support, the major security protocols available on the Internet today.  However, it is InterSoft's position that the encryption/decryption code must be provided by a third party, and will be used by NetTerm if available on your system.  Under no conditions will InterSoft provide software which violates  United States law, or provide direct encryption/decryption code.


S/Key

NetTerm supports  Bellcore's S/Key and  OPIE if the Windows file winkey.exe (written by David Aylesworth) is present on your system.   This file can be found on the Internet at ftp://ftp.bellcore.com/pub/nmh and several other major sites.  The file must be in the windows directory, or any directory within the DOS path.  When a challenge is presented, simply right click on the line that contains the challenge and select the 'Compute S/Key or OPE Response' from the popup menu.  NetTerm will then start winkey.exe and place the challenge on the clipboard for winkey processing.  Once the response has been calculated and winkey has been closed, NetTerm will then read the contents of the clipboard and paste the response at the current cursor position.  The winkey options "Auto Paste Challenge" and "Auto Copy Response" must be selected for proper operation.  Refer to the documentation of winkey for available options and proper operation.


Deslogin

Deslogin software support is currently within NetTerm,  we are waiting on the final encryption/decryption deslogin.dll software to be released by the author of Deslogin.  Once released, simply place the deslogin.dll within your windows directory, and NetTerm will activate the software necessary to use it.


Overview

Script files can automate some tedious tasks such as logging into a system.  A script file is an ASCII text file and may be entered or edited using any standard text editor.  The script file is read line by line.  Empty lines (consisting of white space only) are ignored.  Comments are lines whose first non-space character is a pound sign (#).  The script processor reads each script line, ignoring leading white space, into "words".  A word is defined as either:

A sequence of characters delimited by white space; or

A sequence of characters enclosed in single or double quotes.

The first word of a script file is considered the "command word."  If the last character of the command word is a colon (:), the line is considered to be a LABEL (the object of a GOTO statement).  Otherwise, it is assumed to be a script command and is interpreted as such.  Command words are case insensitive.  Some commands take one or more arguments.  Each argument is parsed as a single word as defined above.  If blanks are required in an argument, the argument MUST be quoted using single or double quotes.  Scripts can be called from the Options menu or from the phone book.

When a string is required for a parameter, all characters up until the end of the command line are processed as the string.  Strings conform to the following format.

A quote character (") means that all characters are to be taken as is without any special meaning until a corresponding closing quote (") has been found.  The string is not permitted to extend over more than one line.

If a caret "^" is found, it denotes that the character following has a special meaning.  Here is a list of the most common special character meanings.

^H	place a back space character into the string (control character 8).

^A	place the port number that the SLIP driver is using into the string.

^L	place a form feed character into the string (control character 12).

^I	place the current IP address into the string.

^J	place a line feed character into the string (control character 10).

^M	place a carriage return character into the string (control character 13).

^P	place the password into the string.

^S	place the modem baud rate into the string.

^I	place a tab character into the string (control character number 9).

^U	place the username (userid) into the string.

^T	place the command line argument host name (-t) option into the string.

^V	place the hosts script file name into the string (see the section on firewalls)


Script Syntax

ABORT

Terminate the script file prior to the end of file.  Returns to terminal mode.

ADDRESS <timeout>

Scan the current line for an IP address.  This command is useful for those Internet Providers which provide dynamic Internet IP addresses for the caller.  An IP address has the format of 999.999.999.999 where '9' represents a numeric value.  If a valid address is found,  it will be placed in a variable which can be accessed by the script.

BREAK <time>

The BREAK command will send a break signal to the modem for a time period of "time" milliseconds.  If time is not given, it will default to five milliseconds.  The optional time value cannot exceed 32767 milliseconds.

COUNT <number>

The COUNT command will load the value "number' in a variable named count.  It will be decrement by one each time it is tested with the IF command.  This value can be used to control the number of times a loop is executed.

ECHO ON|OFF

The ECHO command specifies whether or not characters received from the modem will be displayed on the local terminal.  Since the only time that the script processor looks at the receive queue is during EXPECT processing, the displays may look a bit erratic.  Use the ECHO OFF command to disable local display of received characters during script processing.

EXEC programname

The EXEC command will start the program specified by 'programname'.  Note that if the program is not within the normal Windows/DOS path, the full path must be provided as a part of the name.  For example:

exec \trumpet\tcpman.exe

will start the program tcpman.exe which is located in the \trumpet directory.  Once NetTerm starts the program, the script will continue to the next statement.

EXPECT  <timeout> <text>

Wait for the specified text to appear from the host.  The text argument should be quoted (using single or double quotes) if there are spaces to be transmitted.  Special characters are interpreted the same as for OUTPUT. If the time out argument is specified, NetTerm will wait that number of seconds for the string to appear.  During EXPECT processing, characters received (up to and including the last character found in the text or in the time out) can be displayed to the screen (if TTY ON was specified).

GOTO <label>

Go to the specified label in the script file and continue execution from that point.  The label may either precede or follow the actual GOTO statement.

IF <condition>

<statements>

 ELSE

<statements>

ENDIf

Conditionally execute statements based on specified condition.  NetTerm supports the following conditions:

COUNT              TRUE if count is greater than zero.  (See the count command)

EXPECT	See expect command.

Conditions may be negated using the prefix NOT or the character "!":

!EXPECT	See expect command

NOT EXPECT	Same as !EXPECT above

The ELSE and ENDIF keywords must appear on their own lines.  IF statements may not be nested.

HANGUP

The HANGUP command will terminate the current connection (including hanging up the phone if it is offhook.

ONLINE

Transfer control from NetTerm.  This command is normally used when a program such as tcpman.exe is started with the 'exec' scrip command with a show value of 2.  NetTerm will place itself into an iconic state and will monitor the status of the started program (referred to as task).  When the task terminates, NetTerm will activate itself.  Any communication port opened by NetTerm prior to starting the task will be closed but the modem connection will remain open.  The communication port will be opened again when NetTerm activates itself upon termination of the task.

OUTPUT  [<text>]

Transmit the specified text to the remote.  The text argument should be quoted (using single or double quotes) if there are spaces to be transmitted.  The text is transmitted AS IS (no case conversions are performed).

^   Control character prefix - The next character is made into a control character.

\   Quote prefix - The next character is transmitted verbatim.

The control character prefix ^M would transmit a carriage return and a ^J would transmit a return line.  The quote prefix \^ would transmit the character ^.

The ^P  variable will transmit the last password obtained from the PASSWORD command word .

If there is no text specified (no data or "") , NetTerm will display a dialog box requesting the data to be sent.  If a carriage return is also required for the input data, follow the OUTPUT with another OUTPUT with "^M" as the argument.

PASSWORD  [<prompt>]

The password keyword will stop the script and request your password within a dialog box.  If the optional "prompt" is given, it will be placed in the title line of the dialog box.  The supplied password can then be used in an OUTPUT command to send it to the host computer using the ^P variable.  If a carriage return is also required by the host, follow the OUTPUT password command with a OUTPUT with "^M" as the argument.  The script will continue execution when the password has been entered.

QUIT

Terminate the script and the NetTerm program.

REDIAL

Dial the last number dialed.

SAVE <variable> [<ini section> [<ini file>]]

The save command will place the keyword-value "variable" within the "ini section" of the specified "ini file".  If the "ini section" is not given, it will default to default vars.  If the "ini file" is not given, it will default to trumpwsk.ini.  The following are examples of this command.

save "slip-enabled=1" "Trumpet Winsock" "\windows\trumpwsk.ini"

save "netmask=255.255.255.0" "Trumpet Winsock" "\windows\trumpwsk.ini"

SET <parameter> <value>

Sets the specified parameter to the specified value.  The following are supported:

SET NETWORK MODEM

SET NETWORK TCPIP

SET KEYBOARD XXXXXX

SET EMULATION XXXXXX

SET MODEM PARITY X         (E=Even, O=Odd, N=None, M=Mark, S=Space)

SET MODEM WORD X           (x = 5, 6, 7 or  8)

SET MODEM STOP X             (x = 1.0, or 2.0)

SET MODEM BAUD XXXX     (Any valid rate such as 1200, 2400, 4800, 9600, etc)

SET LOGGING OFF

SET LOGGING fn

The 'LOGGING' command will turn on/off session logging.  When turning session logging on, the full path and name of the log file (fn) must be provided.  If NetTerm determines that the file exists, it will append the session data to this file, otherwise it will create a new file.

Refer to the phone book documentation for a description of what xxxxxx can be for keyboard and emulation.

SLEEP <time>

Suspend execution of the script for the specified number of seconds.  This is usually used for timing considerations; for example, waiting a couple of seconds after receiving the CONNECT message and typing ^C to CompuServe.

SHOW <value>

The show command is used in conjunction with the EXEC command for starting programs.  The optional value determines what state the program should be started in.  Valid values are:

0 = Show task window normal

1 = Place the task in an iconic state

2 = Show task window in a iconic statue and monitor task status for termination.

TRACE ON|OFF

If the argument to the TRACE command is ON, all subsequent command lines that are processed will be displayed on the local screen.  The exception to this is lines containing a OUTPUT command.  These lines will just print "OUTPUT ...", so that passwords, etc. can be protected.  If the argument to the TRACE command is OFF, scripts will execute quietly (this is the default setting).

TRANSFER filename

Transfer control to the script file specified by filename.  The argument should be quoted and must contain the complete path and name of the new script file.  The forward slash should be used to separate path names.  If the control variable ^V is specified, then the current hosts script file will be used as the filename.  Refer to the section on firewalls for more information on the use of this special control sequence.  Example names would be:

"c:/user/scripts/firewall.txt"

"^V"

USERNAME [<prompt>]

The username keyword will stop the script and request your userid within a dialog box.  If the optional "prompt" is given, it will be placed in the title line of the dialog box.  The supplied userid can then be used in an OUTPUT command to send it to the host computer using the ^U variable.  If a carriage return is also required by the host, follow the OUTPUT password command with a OUTPUT with "^M" as the argument.  The script will continue execution when the password has been entered.


Example Dialup Script

# Script to Login to Internet Provider (Dialup Slip Account)

count 5

loop:

    if !count

        hangup

        display "^M^JAborting Script, Maximum count exceeded^M^J"

        abort

    endif

    expect 10 "login:"

    if !expect

        hangup

        redial

        goto loop

    endif

output "myuserid^M"

expect 15 "Password:"

output "mypassword^M"

expect 15 "(unknown)"

output "^M"

expect 15 "$"

sleep 1

output "dslip^M"

expect 10 "Your ip address is "

if !expect

    display Aborting... Could not get IP Address

    abort

endif

address

save "ip=^I"                      "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "slip-port=^A"               "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "slip-baudrate=^S"           "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "netmask=0.0.0.0"            "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "gateway=0.0.0.0"            "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "dns=198.64.6.1 198.64.6.7"  "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "domain=neosoft.com"         "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "slip-enabled=1"             "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "slip-handshake=1"           "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "slip-compressed=1"          "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "ppp-enabled=0"              "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "mtu=1500"                   "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "rwin=6000"                  "Trumpet Winsock" c:\trumpet\trumpwsk.ini

save "mss=1460"                   "Trumpet Winsock" c:\trumpet\trumpwsk.ini

display "^J^MStarting tcpman.exe^J^M"

show 2

exec c:\trumpet\tcpman.exe

online


Example Ethernet Script

expect 10 "login:"

output "myuserid^M"

expect 10 "Password:"

password "Enter Password"

output "^P^M"


Example Firewall Script

expect 10 "Username:"

output "myuserid^M"

expect 10 "Password:"

password "Enter Password"

output "^P^M"

expect 10 "tn-gw>"

output "c ^T^M"


Enhanced Firewall Script

expect 10 "Username:"

output "myuserid^M"

expect 10 "Password:"

password "Enter Password"

output "^P^M"

expect 10 "tn-gw>"

output "c ^T^M"

transfer "^V"


Enhanced Firewall Script for Wingate

# Example Script for Windows 95 WinGate gateway

expect 10 "WinGate>"

output "^T^J"

transfer "^V"


Glossary of Terms

FTP

FTP server

Hayes

modem

PIN

RGB

ZMODEM


FTP

File Transfer Protocol - A method of transferring files over the Internet.


FTP server

The server program for the FTP file transfer protocol.  In a client/server environment, there must be at least one client (FTP) and one server (ftpserve).  A server can handle multiple clients.


Hayes

A common term used to refer to modem command standards.


modem

A modem provides another protocol in data communications.  Modems connect to one another using a pre-defined electrical protocol, usually over dial up phone lines.  A modem connects to your PC via an RS-232 connection.


PIN

Personal Identification Number - Many corporate dial up systems require a PIN as a part of the dial sequence.  If a PIN number is selected, it will be stored in the NETTERM.INI file in an encrypted format.


RGB

A Windows term meaning red, green and blue.  It is commonly used to refer to a method of specifying a screen color in terms of the amount of red, green, and blue that is to be used to define a specific color.


ZMODEM

The most common file transfer protocol on a RS-232 dial up line.  The ZMODEM protocol provides reliable file and command transfers with complete data integrity between application programs.